<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<?php
	include "../../inc/data/conn.php";
	$str=$_GET['q'];
	$stuClass=$str;
	//获取对象
	$sql="select coname from mamx_class,mamx_course,mamx_major
			where mamx_course.majorname=mamx_major.majorname
			and mamx_class.classname=?";
	$stmt=$conn->prepare($sql);
	// 绑定参数
 	$stmt->bind_param("s",$stuClass);
 	// 执行绑定存储
 	$stmt->execute();
 	$stmt->bind_result($cName);
 	$stmt->store_result();
	?>
	
	<?php
		if($stmt->num_rows>0){
			while($stmt->fetch()){
				echo<<<END
				<option value="$cName">$cName</option>
END;
			}
		}else{
			echo<<<END
				<option value="">暂无记录</option>
END;
		}

	?>
	
</body>
</html>